package com.wft.reflect.test02.domain;

import com.wft.reflect.annotation.MyAnnotation;

@MyAnnotation("Stduent class")
public class Student extends Person implements Comparable {
    /**
     * 属性
     */
    @MyAnnotation("Student 属性 id")
    private Integer id;
    double score;
    protected String like;
    public String dream;

    /**
     * 构造器
     */
    @MyAnnotation("Student 空参构造器")
    private Student(){
        System.out.println("Student空参构造器");
    }

    Student(Integer id) {
        this.id = id;
    }

    protected Student(Integer id, double score) {
        this.id = id;
        this.score = score;
    }

    public Student(Integer id, String like, String dream) {
        this.id = id;
        this.like = like;
        this.dream = dream;
    }

    /**
     * 方法
     */
    @MyAnnotation("Student.study()")
    private void study(){
        System.out.println("Student study...");
    }

    void play() {
        System.out.println("Student play...");
    }

    @Override
    protected void sing() {
        System.out.println("Student sing...");
    }

    @Override
    public void dance() {
        System.out.println("Stuent dance...");
    }

    @MyAnnotation("Student dance")
    public void dance(String name) throws NullPointerException {
        System.out.println("Stuent dance..." + name);
    }

    public int compareTo(Object o) {
        return 0;
    }

    @Override
    public String toString() {
        return "Student{" +
                "id=" + id +
                ", score=" + score +
                ", like='" + like + '\'' +
                ", dream='" + dream + '\'' +
                ", name='" + name + '\'' +
                ", height=" + height +
                ", weight=" + weight +
                '}';
    }
}
